<template>
  <div class="app-container uni-scroll" style="height: calc(100vh - 100px)">
    <iframe
      v-if="homePageUrl.indexOf('http') === 0"
      :src="homePageUrl+'&token='+token+'&language='+language+'&userId='+userId+'&hostname='+hostname"
      style="width:100%;height:calc(100vh - 80px)"
      frameborder="no"
      border="0"
      marginwidth="0"
      marginheight="0"
      scrolling="no"
      allowtransparency="yes"
    />
    <Default v-else />
  </div>
</template>
<script>
import { getHomePageUrl, getLanguage, getToken, getUserId } from '@/util/storage'
import Default from './default'
export default {
  components: {
    Default
  },
  data() {
    return {
      homePageUrl: '',
      token: getToken(),
      language: getLanguage(),
      userId: getUserId(),
      hostname: window.location.hostname
    }
  },
  created() {
    const homePageUrl = getHomePageUrl()
    if (homePageUrl != null) {
      this.homePageUrl = homePageUrl
      return
    }
  },
  methods: {

  }
}
</script>
